package Test;

import static org.junit.Assert.*;


import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import DBLayer.DBKunde;

import ModelLayer.Kunde;

public class TestDBKunde {
	private DBKunde dbObject;
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
		dbObject = new DBKunde();
	}

	@After
	public void tearDown() throws Exception {
	}


	@Test
	public void testSearchKundeID() 
	{
		System.out.println("Finder en kunde via ID");
		Kunde kObject = dbObject.findKunde(1, false);
		if(kObject != null)
		{
			System.out.println(kObject.getKundeID());
			System.out.println(kObject.getNavn());
			System.out.println(kObject.getAdresse());
			System.out.println(kObject.getByNavn());
			System.out.println(kObject.getPostNr());
			System.out.println(kObject.getTelefonNr());
			System.out.println(kObject.geteMail());
		}
		else {
			fail("Kunde ikke fundet");
		}
	}


}
